import {
  createStore,
  applyMiddleware,
  combineReducers
} from 'redux'

import thunk from 'redux-thunk'

import countReducer from './reducers/count_reducer'
import movieReducer from './reducers/movie_reducer'

// 合并多个 reducer (dispatch 不变)
const allReducer = combineReducers({
  countReducer,
  movieReducer
})

const store = new createStore(allReducer, applyMiddleware(thunk))

export default store